<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no,viewport-fit=cover">
  <script src="https://jsmpeg.com/jsmpeg.min.js" charset="utf-8"></script>
  <title>播放rtsp</title>
</head>
<body>
	<!-- canvas 宽高比例尽量与视频比例保持一致。 -->
	<canvas id="canvas-1" style="width: 600px;"></canvas>
</body>
<script>
    var rtsp = 'rtsp://127.0.0.1:8554/camera_test'
  window.onload = () => {
    // 将rtsp视频流地址进行btoa处理一下
    new JSMpeg.Player("ws://localhost:9999/rtsp?url="+btoa(rtsp), {
       canvas: document.getElementById("canvas-1")
    })
  }
</script>
</html>
